<template>
  <basic-container class="information-box">
    <dataList
      placeholder="请输入工程名称"
      :pageInfo="pager"
      :listData="tableData"
      :selectData="selectDataArr"
      searchName="projectName"
      :menuList="['add','delete']"
      :filterList="filterList"
      openSelection
      @menu-click="handleMenuClick"
    >
      <el-table ref="multipleTable" align="center" :data="tableData" style="width: 100%" @selection-change="$event => (selectDataArr = $event)">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column label="工程名称" prop="projectName"></el-table-column>
        <el-table-column label="工程地址" prop="projectAddress"></el-table-column>
        <el-table-column label="工程类型" prop="projectType" width="100">
          <template slot-scope="scope">{{getCardTypeValue(scope.row.projectType,projectTypes)}}</template>
        </el-table-column>
        <el-table-column label="代建单位" prop="agentInfo"></el-table-column>
        <el-table-column label="单位联系人" prop="agentContact" width="100"></el-table-column>
        <el-table-column label="联系电话" prop="agentPhone" width="120"></el-table-column>
        <el-table-column label="操作" width="180">
          <template slot-scope="scope">
            <el-button type="text" @click="handleToEdit(scope.row)">编辑</el-button>
            <span class="line">|</span>
            <el-button type="text" @click="handleToLook(scope.row)">查看</el-button>
            <span class="line" v-if="scope.row.projectStatus == '200'">|</span>
            <el-button type="text" v-if="scope.row.projectStatus == '200'" @click="handleToDelete(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </dataList>
    <edit-data ref="editData" @resetList="resetList" @handleClose="handleClose" v-if="editDataShow" @beforeClose="handleClose"></edit-data>
    <showActual ref="showActual" @handleClose="handleShowClose" v-if="showActual" @beforeClose="handleShowClose"></showActual>
  </basic-container>
</template>

<script src="./index.js">

</script>

<style lang="scss" scoped>
.information-box {
  .line {
    display: inline-block;
    width: 10px;
    text-align: center;
    color: #999;
  }
}
</style>
